# encoding=gbk
import opennsfw2 as n2
import time

def videoDetection(path):
    elapsed_seconds, nsfw_probabilities = n2.predict_video_frames(path)
    res = []
    for second, probability in zip(elapsed_seconds, nsfw_probabilities):
        temp = { "second" : str(format(second,".2f")) + "s", "probability" : str(probability) + "%"}
        res.append(temp)
    return res

